package com.liu.demo.controller;

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@RestController
public class jdbcController {


    @Resource
    JdbcTemplate jdbcTemplate;

    @RequestMapping("/selectUser")
    public List<Map<String, Object>> selectUser(){
        String sql = "select * from stu";
        List<Map<String, Object>> maps = jdbcTemplate.queryForList(sql);
        return maps;
    }





}
